package com.example.zhenyi;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

import java.io.IOException;

public class HelloApplication extends Application {


    @Override
    public void start(Stage stage) throws IOException {
//        FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("zhenyi-view.fxml"));
//        Scene scene = new Scene(fxmlLoader.load(), 700, 386);
//        stage.setTitle("爱康健康管理有限公司-导出振宜体检数据");
//        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
//            @Override
//            public void handle(WindowEvent windowEvent) {
//                System.exit(0);
//            }
//        });
//        stage.setResizable(false);
//
//        FXMLLoader fxmlLoaderLogin = new FXMLLoader(HelloApplication.class.getResource("login-view.fxml"));
//        Scene loginScene = new Scene(fxmlLoaderLogin.load(), 300, 180);
//
//
//        stage.setScene(scene);
//        stage.show();

        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent windowEvent) {
                System.exit(0);
            }
        });
        stage.setResizable(false);
        FXMLLoader fxmlLoaderLogin = new FXMLLoader(HelloApplication.class.getResource("login-view.fxml"));
        Scene scene = new Scene(fxmlLoaderLogin.load(), 300, 180);
        stage.setScene(scene);
        stage.setTitle("登录");
        Image icon = new Image(getClass().getResourceAsStream("/爱康.jpg" ));
        stage.getIcons().add(icon);
        stage.show();
    }


    public static void main(String[] args) {
        launch();
    }
}